package com.eshop.inventory.config;

import com.eshop.inventory.listener.InitListener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: Xukai
 * @description: 线程池+内存队列相关
 * @createDate: 2018/7/23 00:58
 * @modified By:
 */
@Configuration
public class ServletListenerConfig {

    /**
     * 线程池+内存队列初始化，注册监听器
     * @return
     */
    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean(){
        ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
        servletListenerRegistrationBean.setListener(new InitListener());
        return servletListenerRegistrationBean;
    }
}
